Skip to content

Cap domains loaded per list_domains request - #3271

Open
jicelhay wants to merge 1 commit into
google:masterfrom
jicelhay:limitlistdomains
Open

jicelhay wants to merge 1 commit into
google:masterfrom
jicelhay:limitlistdomains

Conversation

@jicelhay

@jicelhay jicelhay commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

ListDomainsAction loads every matching domain into memory before responding, which can exhaust the server's memory when listing many or large TLDs.

This caps a single request at 10,000 domains. If more than that match and no --limit of 10,000 or less is given, the action returns an error rather than a silently truncated list. Listings of up to 10,000 domains, and any request with --limit of 10,000 or less, behave as before.

The --limit help text now mentions the cap.

b/585183729


This change is Reviewable

@jicelhay jicelhay self-assigned this Nov 12, 2026
@jicelhay
jicelhay requested a review from weiminyu November 12, 2026 22:15

@weiminyu weiminyu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weiminyu made 1 comment.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on jicelhay).


core/src/main/java/google/registry/tools/ListDomainsCommand.java line 46 at r1 (raw file):

              + MAX_DOMAINS
              + " domains per request and returns an error if more match.")
  private int maxDomains = Integer.MAX_VALUE;

Should we change the initial value and verify user provided one if present?

Code quote:

maxDomains = Integer.MAX_VALUE

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants